<script setup>
import { ref, defineOptions } from "vue";

import moduleAdd from "./moduleAdd.vue";
import moduleMine from "./moduleMine.vue";
import moduleSetting from "./moduleSetting.vue";

defineOptions({
  name: "pageSetting",
});

let currentTab = ref("add");

function toChangeCurTabFn(data) {
  currentTab.value = data;
}
</script>
<template>
  <div class="page-setting-wrapper">
    <div class="page-setting-content">
      <ul class="module-tabs">
        <li
          class="module-tab-item"
          :class="currentTab === 'add' ? 'actived' : ''"
          @click="toChangeCurTabFn('add')"
        >
          <span class="tab-item-icon"></span><span class="tab-item-text">添加</span>
        </li>
        <li
          class="module-tab-item"
          :class="currentTab === 'mine' ? 'actived' : ''"
          @click="toChangeCurTabFn('mine')"
        >
          <span class="tab-item-icon"></span><span class="tab-item-text">我的</span>
        </li>
        <li
          class="module-tab-item"
          :class="currentTab === 'setting' ? 'actived' : ''"
          @click="toChangeCurTabFn('setting')"
        >
          <span class="tab-item-icon"></span><span class="tab-item-text">设置</span>
        </li>
      </ul>
      <div class="module-tab-item-content">
        <div class="tab-item-content-item module-add-box" v-if="currentTab === 'add'">
          <moduleAdd />
        </div>
        <div
          class="tab-item-content-item module-mine-box"
          v-else-if="currentTab === 'mine'"
        >
          <moduleMine />
        </div>
        <div class="tab-item-content-item module-setting-box" v-else>
          <moduleSetting />
        </div>

      </div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.module-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background-color: #666;
  .module-tab-item {
    color: #ccc;
    font-size: 18px;
    font-weight: 700;
    line-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid #ccc;
    box-sizing: border-box;
  }
  .actived {
    color: #4abbf8;
    border-bottom: 2px solid #4abbf8;
  }
}
.module-tab-item-content {
  .tab-item-content-item {
    padding: 20px 0;
    box-sizing: border-box;
    height: calc(100vh - 100px);
    overflow: hidden;
  }
  .module-add-box {
  }
  .module-mine-box {
  }
  .module-setting-box {
  }
}
</style>
